<%--
  Created by IntelliJ IDEA.
  User: star
  Date: 2016/9/29
  Time: 9:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name=”viewport” content=”width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no” />
    <title>首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="<%=request.getContextPath()%>/Css/adminStyle.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap-responsive.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/style.css"/>

    <link href="<%=request.getContextPath()%>/Css/jquery-ui.min.css"
          type="text/css" rel="stylesheet"/>

    <title>首页</title>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery1.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery2.js"></script>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/js/jquery-ui.min.js"></script>
    <script type="text/javascript">
        $(document).ready(
                function () {
                    $(".div2").click(
                            function () {
                                $(this).next("div").slideToggle("slow").siblings(
                                        ".div3:visible").slideUp("slow");
                            });
                });
        function openurl(url) {
            var rframe = parent.document.getElementById("rightFrame");
            rframe.src = url;
        }
    </script>
    <style>
        body {
            margin: 0;
            font-family: 微软雅黑;
            /*background-image: url(../images/77.jpg);*/
            background-repeat: no-repeat;
            background-size: cover;
            background-attachment: fixed;
          /*  background-color: #DDDDDD*/

        }

        .top1 {
            position: absolute;
            top: 0px;
            width: 100%;
            height: 20px;
            text-align: center;
            color: #FFFFFF;
            font-size: 17px;
            font-height: 20px;
            font-family: 楷体;
            background-color: #888888
        }

        .title {
            float:left;
            margin:-2px 20px;
            font-size: 40px;
            color: #FFFFFF;
            font-height: 55px;
            font-family: 隶书;
        }

        .top2 {
            position: absolute;
            top: 20px;
            width: 100%;
            height: 77px;
            text-align: center;
            color: #ccffff;
                background-color: #888888
        }

        .left {
            position: absolute;
            left: 0px;
            top: 97px;
            width: 200px;
            height: 85%;
            border-right: 1px solid #9370DB;
            color: #000000;
            font-size: 20px;
            text-align: center;
         /*   background-color: #B3B3B3*/
        }

        .right {
            position: absolute;
            left: 200px;
            top:97px;
            width: 85.2%;
            height: 85%;
            border-top: 0px solid #484860;
            font-size: 14px;
            text-align: center;
        }

        .end {
            position: absolute;
            bottom: 0px;
            width: 100%;
            height: 30px;
            text-align: center;
            color: #556B2F;
            font-size: 17px;
            font-height: 20px;
            font-family: 楷体;
            background-color: #C0C0C0
        }

        .div1 {
            text-align: center;
            width: 200px;
            padding-top: 10px;
        }

        .div2 {
            height: 40px;
            line-height: 40px;
            cursor: pointer;
            font-size: 18px;
            position: relative;
            border-bottom: #ccc 0px dotted;
        }

        .spgl {
            position: absolute;
            height: 20px;
            width: 20px;
            left: 40px;
            top: 10px;
            background: url(../images/1.png);
        }

        .yhgl {
            position: absolute;
            height: 20px;
            width: 20px;
            left: 40px;
            top: 10px;
            background: url(../images/4.png);
        }

        .gggl {
            position: absolute;
            height: 20px;
            width: 20px;
            left: 40px;
            top: 10px;
            background: url(../images/4.png);
        }

        .zlgl {
            position: absolute;
            height: 20px;
            width: 20px;
            left: 40px;
            top: 10px;
            background: url(../images/4.png);
        }

        .pjgl {
            position: absolute;
            height: 20px;
            width: 20px;
            left: 40px;
            top: 10px;
            background: url(../images/4.png);
        }

        .tcht {
            position: absolute;
            height: 20px;
            width: 20px;
            left: 40px;
            top: 10px;
            background: url(../images/2.png);
        }

        .div3 {
            display: none;
            cursor: pointer;
            font-size: 15px;
        }

        .div3 ul {
            margin: 0;
            padding: 0;
        }

        .div3 li {
            height: 30px;
            line-height: 30px;
            list-style: none;
            border-bottom: #ccc 1px dotted;
            text-align: center;
        }

        .a {
            text-decoration: none;
            color: #000000;
            font-size: 15px;
        }

        .a1 {
            text-decoration: none;
            color: #000000;
            font-size: 18px;
        }
    </style>
</head>
<body>
<div class="top1">
    <marquee scrollAmount=2 width=300>数据无价，请谨慎操作！</marquee>
</div>
<div class="top2">
    <div class="logo">
        <img src="../images/admin_logo.png" title="在哪儿"/>
    </div>
    <div class="title">
        <h1>炸金花管理系统</h1>
        <<%--h1>鬼的后台</h1>--%>
    </div>
    <div class="fr top-link">
        <a href="#" target="mainCont" title="${loginName}"><i
                class="adminIcon"></i><span>管理员：${loginName}</span></a>
        <a href="#" onclick="changePwd(${loginUser.id},'${loginUser.userAccount}')" ><span>修改密码</span></a>
    </div>
</div>

<div class="left">
    <div class="div1">
        <div class="left_top">
            <img src="../images/bbb_01.jpg"><img src="../images/bbb_02.jpg"
                                                 id="2"><img src="../images/bbb_03.jpg"><img
                src="../images/bbb_04.jpg">
        </div>

        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/player/queryPlayerList.html');">
            <div class="div2">
                <div class="tcht"></div>玩家管理</div>
        </a>

        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/club/managerInfo.html');">
            <div class="div2">
                <div class="tcht"></div>
                 &nbsp;&nbsp;代理商管理
            </div>
        </a>


            <a class="a1" href="javascript:void(0);"
              onClick="openurl('<%=request.getContextPath()%>/agent/agentCoinOperate.html');">
               <div class="div2">
                   <div class="tcht"></div>
                   &nbsp;&nbsp; 代理商充值
               </div>
           </a>
        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/player/queryRechargeRecord.html');">
            <div class="div2">
                <div class="tcht"></div>
                充值记录
            </div>
        </a>

        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/game/queryPayRecord.html');">
            <div class="div2">
                <div class="tcht"></div>
                消费记录
            </div>
        </a>
        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/game/statistics.html');">
            <div class="div2">
                <div class="tcht"></div>
                信息统计
            </div>
        </a>
        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/order/queryOrder.html');">
            <div class="div2">
                <div class="tcht"></div>
                分包统计
            </div>
        </a>


        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/club/queryMessageList.html');">
            <div class="div2">
                <div class="tcht"></div>
                公告设置
            </div>
        </a>
         <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/club/getApplication.html');">
            <div class="div2">
                <div class="tcht"></div>
                申请记录
            </div>
        </a>
        <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/club/gameContro.html');">
            <div class="div2">
                <div class="tcht"></div>
               游戏控制
            </div>
        </a>
      <%--  <a class="a1" href="javascript:void(0);"
           onClick="openurl('<%=request.getContextPath()%>/version/queryVersionInfo.html');">
            <div class="div2">
                <div class="tcht"></div>
                &nbsp;&nbsp; 版本号控制
            </div>
        </a>--%>


        <a class="a1" href="<%=request.getContextPath()%>/user/logout.html">
            <div class="div2">
                <div class="tcht"></div>
                退出后台
            </div>
        </a>


    </div>
</div>


<div id="managerEditDiv" style="display: none;">
    <form action="/" method="post" id="editForm">
        <input id="user_id" name="user_id" type='hidden' value=""/>
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td><label for="user_name"><span
                        style="color:#F00; margin-right:2px;">*</span>账户：
                </label>
                </td>
                <td><input id="user_name" name="user_name" type='text' class="sp_t"
                           value="" readonly="readonly"/></td>
            </tr>
            <tr>
                <td><label for="newPwd"><span
                        style="color:#F00; margin-right:2px;">*</span>新密码：
                </label>
                </td>
                <td><input id="newPwd" name="newPwd" type='text'/></td>
            </tr>

            <tr>
                <td><label for="repeatPwd"><span
                        style="color:#F00; margin-right:2px;">*</span>确认密码：
                </label>
                </td>
                <td><input id="repeatPwd" name="repeatPwd" type='text'/>
                    <div id="passWordMsg" style="padding-left:35px;margin-top:0px;font-size:12px; color:red;"></div>
                </td>
            </tr>
        </table>
    </form>
</div>

<div class="right">
    <iframe id="rightFrame" name="rightFrame" width="100%" height="100%"
            scrolling="auto" marginheight="0" marginwidth="0" align="center"
            style="border: 0px solid #CCC; margin: 0; padding: 0;"></iframe>
</div>


</body>
<script type="text/javascript">
    function changePwd(id, account) {
        $("#user_id").val(id);
        $("#user_name").val(account)
        $("#managerEditDiv").dialog({
            title: "修改密码",
            height: 300,
            width: 400,
            modal: true,
            open: function (event, ui) {
                $(".ui-dialog-titlebar-close", $(this).parent()).hide();
            },
            buttons: {
                "确定": function () {
                    judgePwd();
//  editPwd();
                },
                "取消": function () {
                    resetAll();
                    $(this).dialog("close");
                }
            }
        });
    }


    function judgePwd() {

        var newPwd = $("#newPwd").val();
        var repeatPwd = $("#repeatPwd").val();
        if (newPwd == '') {
            $('#passWordMsg').html("请输入新密码");
            return;
        }
        if (repeatPwd == '') {
            $('#passWordMsg').html("请输入确认密码");
            return;
        }

        if (newPwd !== repeatPwd) {
            $('#passWordMsg').html("密码不一致");
            return;
        }

        $.ajax({
            type: "POST",
            url: "<%=request.getContextPath()%>/manager/changePwd.html",
            data:  $('#editForm').serialize(),
            dataType: 'json',
            success: function (data) {
                var row = data.effectRow;
                if (row > 0 ) {
                     window.location.href="<%=request.getContextPath()%>/user/login.html";
                }else{
                    alert("密码修改失败，请联系管理员");
                }
            }
        });


    }


    function resetAll() {
        var myform = document.getElementById("editForm");
        myform.reset();
    }
</script>
</html>
